/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package protocol;

import utility.DemoMD5;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;

/**
 *
 * @author Reinhard
 */
public class Protocol {
  private static int WAITING = 0;
  private static int LOGGED_IN = 1;
  
  private int state = WAITING;
  
  public Protocol() {
    
  }
  
  public static String LoginRequestProtocol(String username,String password) throws NoSuchAlgorithmException, UnsupportedEncodingException{
        return "10 " + DemoMD5.MD5(username) + " " + DemoMD5.MD5(password);
  }
  
  
  
  public String processInput(String input) {
    String ret = null;
    
    if(state == WAITING) {
      ret = "WAITING";
    }
    
    return ret;
  }
  
}
